﻿@{
    ViewBag.Title = "系统出错";
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="~/scripts/jquery.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
            font-family: 'microsoft yahei','simsun';
        }

        body {
            background: #f2f2f2;
        }

        .w {
            width: 990px;
            height: 210px;
            padding: 0;
            margin: 0 auto;
            zoom: 1;
        }

        .login_btn {
            background: #188eee;
            width: 100px;
            height: 25px;
            text-align: center;
        }

        .test_box {
            text-align: left;
            float: left;
            width: 350px;
            min-height: 80px;
            max-height: 200px;
            _height: 90px;
            margin-bottom: 20px;
            padding: 3px;
            outline: 0;
            border: 1px solid #a0b3d6;
            font-size: 12px;
            color: #999;
            word-wrap: break-word;
            overflow-x: hidden;
            overflow-y: auto;
            _overflow-y: visible;
            background-color: aliceblue;
        }

        .error-page {
            width: 345px;
            height: 320px;
            padding: 20px 165px 60px 475px;
            font-size: 12px;
            overflow: hidden;
            color: #5f5656;
            margin: 100px 0 35px;
            background: url(/themes/default/Images/error.jpg) #fff no-repeat 150px 30px;
            border: 1px solid #ddd;
        }

            .error-page h2 {
                font-size: 20px;
                margin-bottom: 10px;
                margin-top: 5px;
                color: #E4393C;
                font-weight: normal;
            }

            .error-page p {
                font-size: 14px;
            }

            .error-page a {
                color: #e3393c;
            }

        #footer {
            padding-bottom: 30px;
            text-align: center;
            font-size: 12px;
        }

            #footer .copyright {
                margin: 10px 0;
            }
    </style>

    <script type="text/javascript">
        function regsoft() {
            if ($("#regcode").html() == "") {
                alert("注册码不能为空!");
                return;
            }
            //1. "+"号：JavaScript解析为字符串连接符，所以服务器端接收数据时"+"会丢失。
            //2. "&"：JavaScript解析为变量连接符，所以服务器端接收数据时&符号以后的数据都会丢失。
            var regcode = $("#regcode").html();
            regcode = regcode.replace(/\+/g, "%2B");
            regcode = regcode.replace(/\&/g, "%26");
            $.ajax({
                type: "get",
                url: "/home/regsoftware?regcode=" + regcode,
                //data: dataStr,
                //dataType: "json",
                contentType: "application/json",
                success: function (d) {
                    window.location.href = "/";
                },
                error: function (e) {
                    alert(e.responseText);
                }
            });
        }
    </script>
</head>

<body>
    <div class="w">
        <div class="error-page">
            <h2>抱歉，你没有权限访问此页面…</h2>
            <div id="reg" style="word-wrap:break-word;">@TempData["Message"]</div>
            <h2>注册码</h2>
            <div contenteditable="true" class="test_box" id="regcode"></div><p></p>
            <div><input type="button" value="马上注册" onclick="regsoft()" class="btn login_btn" /></div>
        </div>
    </div>
    <div class="w">
        <div id="footer">
        </div>
    </div>
</body>
</html></script>